<!DOCTYPE html>
<html>
<head>
    <title>填写申请信息</title>
    #parse("/inc/meta.htm")
</head>
<body id="inner_page_start">
<div id="wrapper">
    <div id="content-wrapper">
        <!-- /.container-fluid -->
        <div class="container-fluid">
            <form method="post" action="/channelInput" id="form-pool-up">
                <input type="hidden" value="$!qcode" name="qcode" />
                <div class="form-group row">
                    <div class="col-sm-2"></div>
                    <label for="inputName" class="col-sm-2 col-form-label">姓名</label>
                    <div class="col-sm-6">
                        <input type="text" class="form-control" id="inputName" placeholder="姓名" required="required"
                               autofocus="autofocus" name="name" />
                    </div>
                    <div class="col-sm-2"></div>
                </div>

                <div class="form-group row">
                    <div class="col-sm-2"></div>
                    <label for="inputTelphone" class="col-sm-2 col-form-label">手机号码</label>
                    <div class="col-sm-6">
                        <input type="text" class="form-control" id="inputTelphone" placeholder="手机号码"
                               required="required"  name="tel" />
                    </div>
                    <div class="col-sm-2"></div>
                </div>

                <div class="form-group row">
                    <div class="col-sm-2"></div>
                    <label for="inputAge" class="col-sm-2 col-form-label">年龄</label>
                    <div class="col-sm-6">
                        <input type="number" max="65" min="18" class="form-control" id="inputAge" name="age"
                               required="required"/>
                    </div>
                    <div class="col-sm-2"></div>
                </div>

                <div class="form-group row">
                    <div class="col-sm-2"></div>
                    <label class="col-sm-2 col-form-label">性别</label>
                    <div class="col-sm-6">
                        <select name="sex" class="form-control" required>
                            <option value="1" >男</option>
                            <option value="0" >女</option>
                        </select>
                    </div>
                </div>

                <div class="form-group row">
                    <div class="col-sm-2"></div>
                    <label class="col-sm-2 col-form-label">城市名称</label>
                    <div class="col-sm-6">
                       <select class="form-control short-form" id="province-selector" onchange="cityList(this.value)">
                        #foreach($prov in $provList)
                        <option value="$prov.code" >$prov.name</option>
                        #end
                    </select> 省 ，

                        <select class="form-control short-form" id="city-selector" name="citycode" onchange="setName()" required>
                            #foreach($city in $cityList)
                            <option value="$city.code">$city.name</option>
                            #end
                        </select> 市 。
                    </div>
                    <div class="col-sm-2"></div>
                </div>

                <input type="hidden" class="form-control" id="inputCity" value="" name="city" />

                <div class="form-group row">
                    <div class="col-sm-2"></div>
                    <label class="col-sm-2 col-form-label">贷款金额</label>
                    <div class="col-sm-6">
                        #foreach( $key in $tagInfo["16"] )
                        <div class="form-check form-check-inline">
                            <input class="form-check-input" type="radio" name="loan_amount" id="inputLoan_amount$key.value"
                                   required  value="$key.value">
                            <label class="form-check-label" for="inputLoan_amount$key.value">$key.name</label>
                        </div>
                        #end
                    </div>
                    <div class="col-sm-2"></div>
                </div>

                <div class="form-group row">
                    <div class="col-sm-2"></div>
                    <label for="inputLoan_period" class="col-sm-2 col-form-label">贷款时限(月)</label>
                    <div class="col-sm-6">
                        <input type="number" max="36" min="1" class="form-control" id="inputLoan_period" name="loan_period"
                               required="required"/>
                    </div>
                    <div class="col-sm-2"></div>
                </div>

                <div class="form-group row">
                    <div class="col-sm-2"></div>
                    <label class="col-sm-2 col-form-label">贷款用途</label>
                    <div class="col-sm-6">
                        #foreach( $key in $tagInfo["1"] )
                        <div class="form-check form-check-inline">
                            <input class="form-check-input" type="radio" name="loan_use" id="inputLoan_use$key.value"
                                   required  value="$key.value">
                            <label class="form-check-label" for="inputLoan_use$key.value">$key.name</label>
                        </div>
                        #end
                    </div>
                    <div class="col-sm-2"></div>
                </div>

                <div class="form-group row">
                    <div class="col-sm-2"></div>
                    <label class="col-sm-2 col-form-label">户籍</label>
                    <div class="col-sm-6">
                        #foreach( $key in $tagInfo["2"] )
                        <div class="form-check form-check-inline">
                            <input class="form-check-input" type="radio" name="census" id="inputCensus$key.value"
                                   required value="$key.value">
                            <label class="form-check-label" for="inputCensus$key.value">$key.name</label>
                        </div>
                        #end
                    </div>
                    <div class="col-sm-2"></div>
                </div>

                <div class="form-group row">
                    <div class="col-sm-2"></div>
                    <label class="col-sm-2 col-form-label">社保</label>
                    <div class="col-sm-6">
                        #foreach( $key in $tagInfo["7"] )
                        <div class="form-check form-check-inline">
                            <input class="form-check-input" type="radio" name="social_security" id="inputSocial_security$key.value"
                                   required  value="$key.value">
                            <label class="form-check-label" for="inputSocial_security$key.value">$key.name</label>
                        </div>
                        #end
                    </div>
                    <div class="col-sm-2"></div>
                </div>

                <div class="form-group row">
                    <div class="col-sm-2"></div>
                    <label class="col-sm-2 col-form-label">公积金</label>
                    <div class="col-sm-6">
                        #foreach( $key in $tagInfo["7"] )
                        <div class="form-check form-check-inline">
                            <input class="form-check-input" type="radio" name="provident_fund" id="inputProvident_fund$key.value"
                                   required value="$key.value">
                            <label class="form-check-label" for="inputProvident_fund$key.value">$key.name</label>
                        </div>
                        #end
                    </div>
                    <div class="col-sm-2"></div>
                </div>

                <div class="form-group row">
                    <div class="col-sm-2"></div>
                    <label class="col-sm-2 col-form-label">职业</label>
                    <div class="col-sm-6">
                        #foreach( $key in $tagInfo["3"] )
                        <div class="form-check form-check-inline">
                            <input class="form-check-input" type="radio" name="job" id="inputJob$key.value"
                                   required  value="$key.value">
                            <label class="form-check-label" for="inputJob$key.value">$key.name</label>
                        </div>
                        #end
                    </div>
                    <div class="col-sm-2"></div>
                </div>

                <div class="form-group row">
                    <div class="col-sm-2"></div>
                    <label class="col-sm-2 col-form-label">月收入</label>
                    <div class="col-sm-6">
                        #foreach( $key in $tagInfo["4"] )
                        <div class="form-check form-check-inline">
                            <input class="form-check-input" type="radio" name="income" id="inputIncome$key.value"
                                   required value="$key.value">
                            <label class="form-check-label" for="inputIncome$key.value">$key.name</label>
                        </div>
                        #end
                    </div>
                    <div class="col-sm-2"></div>
                </div>

                <div class="form-group row">
                    <div class="col-sm-2"></div>
                    <label class="col-sm-2 col-form-label">收入形式</label>
                    <div class="col-sm-6">
                        #foreach( $key in $tagInfo["5"] )
                        <div class="form-check form-check-inline">
                            <input class="form-check-input" type="radio" name="incometype" id="inputIncometype$key.value"
                                   required value="$key.value">
                            <label class="form-check-label" for="inputIncometype$key.value">$key.name</label>
                        </div>
                        #end
                    </div>
                    <div class="col-sm-2"></div>
                </div>

                <div class="form-group row">
                    <div class="col-sm-2"></div>
                    <label class="col-sm-2 col-form-label">信用卡</label>
                    <div class="col-sm-6">
                        #foreach( $key in $tagInfo["6"] )
                        <div class="form-check form-check-inline">
                            <input class="form-check-input" type="radio" name="creditcard" id="inputCreditcard$key.value"
                                   required value="$key.value">
                            <label class="form-check-label" for="inputCreditcard$key.value">$key.name</label>
                        </div>
                        #end
                    </div>
                    <div class="col-sm-2"></div>
                </div>

                <div class="form-group row">
                    <div class="col-sm-2"></div>
                    <label class="col-sm-2 col-form-label">微粒贷</label>
                    <div class="col-sm-6">
                        #foreach( $key in $tagInfo["6"] )
                        <div class="form-check form-check-inline">
                            <input class="form-check-input" type="radio" name="haswld" id="inputHaswld$key.value"
                                   required  value="$key.value">
                            <label class="form-check-label" for="inputHaswld$key.value">$key.name</label>
                        </div>
                        #end
                    </div>
                    <div class="col-sm-2"></div>
                </div>
                <div class="form-group row">
                    <div class="col-sm-2"></div>
                    <label class="col-sm-2 col-form-label">房产</label>
                    <div class="col-sm-6">
                        #foreach( $key in $tagInfo["13"] )
                        <div class="form-check form-check-inline">
                            <input class="form-check-input" type="radio" name="hashouse" id="inputHashouse$key.value"
                                   required  value="$key.value">
                            <label class="form-check-label" for="inputHashouse$key.value">$key.name</label>
                        </div>
                        #end
                    </div>
                    <div class="col-sm-2"></div>
                </div>
                <div class="form-group row">
                    <div class="col-sm-2"></div>
                    <label class="col-sm-2 col-form-label">车产</label>
                    <div class="col-sm-6">
                        #foreach( $key in $tagInfo["11"] )
                        <div class="form-check form-check-inline">
                            <input class="form-check-input" type="radio" name="hascar" id="inputHascar$key.value"
                                   required value="$key.value">
                            <label class="form-check-label" for="inputHascar$key.value">$key.name</label>
                        </div>
                        #end
                    </div>
                    <div class="col-sm-2"></div>
                </div>

                <div class="form-group row">
                    <div class="col-sm-2"></div>
                    <label class="col-sm-2 col-form-label">寿险保单</label>
                    <div class="col-sm-6">
                        #foreach( $key in $tagInfo["6"] )
                        <div class="form-check form-check-inline">
                            <input class="form-check-input" type="radio" name="haslife" id="inputHaslife$key.value"
                                   required value="$key.value">
                            <label class="form-check-label" for="inputHaslife$key.value">$key.name</label>
                        </div>
                        #end
                    </div>
                    <div class="col-sm-2"></div>
                </div>

                <div class="form-group row">
                    <div class="col-sm-2"></div>
                    <label class="col-sm-2 col-form-label">车辆抵押</label>
                    <div class="col-sm-6">
                        #foreach( $key in $tagInfo["12"] )
                        <div class="form-check form-check-inline">
                            <input class="form-check-input" type="radio" name="carpawn" id="inputCarpawn$key.value"
                                   required value="$key.value">
                            <label class="form-check-label" for="inputCarpawn$key.value">$key.name</label>
                        </div>
                        #end
                    </div>
                    <div class="col-sm-2"></div>
                </div>
                <div class="form-group row">
                    <div class="col-sm-2"></div>
                    <label class="col-sm-2 col-form-label">房产抵押</label>
                    <div class="col-sm-6">
                        #foreach( $key in $tagInfo["12"] )
                        <div class="form-check form-check-inline">
                            <input class="form-check-input" type="radio" name="housepawn" id="inputHousepawn$key.value"
                                required   value="$key.value">
                            <label class="form-check-label" for="inputHousepawn$key.value">$key.name</label>
                        </div>
                        #end
                    </div>
                    <div class="col-sm-2"></div>
                </div>

                <div class="form-group row">
                    <div class="col-sm-2"></div>
                    <label class="col-sm-2 col-form-label">芝麻分</label>
                    <div class="col-sm-6">
                        #foreach( $key in $tagInfo["8"] )
                        <div class="form-check form-check-inline">
                            <input class="form-check-input" type="radio" name="zmscore" id="inputZmscore$key.value"
                                   required   value="$key.value">
                            <label class="form-check-label" for="inputZmscore$key.value">$key.name</label>
                        </div>
                        #end
                    </div>
                    <div class="col-sm-2"></div>
                </div>
                <div class="form-group row">
                    <div class="col-sm-2"></div>
                    <label class="col-sm-2 col-form-label">征信</label>
                    <div class="col-sm-6">
                        #foreach( $key in $tagInfo["9"] )
                        <div class="form-check form-check-inline">
                            <input class="form-check-input" type="radio" name="credit" id="inputCredit$key.value"
                                   required value="$key.value">
                            <label class="form-check-label" for="inputCredit$key.value">$key.name</label>
                        </div>
                        #end
                    </div>
                    <div class="col-sm-2"></div>
                </div>

                <div class="form-group row">
                    <div style="margin: 0 auto;width: 200px ;">
                        <button type="reset" class="btn">清空</button>
                        <div style="display: inline;padding: 0 20px;"></div>
                        <button type="submit" class="btn btn-primary">录入</button>
                    </div>
                </div>
            </form>
        </div>
    </div>
    <!-- /.content-wrapper -->
</div>
#parse("/inc/footer.htm")
<script>
    $("#province-selector").val("")
    if(!$("#city-selector").val()){
        $("#province-selector").val("")
    }

    function setName()
    {
        $("#inputCity").val($("#city-selector").find("option:selected").text())
    }

    $("#form-pool-up").on("reset",function () {
        $("#errorInfo").text("");
        $("#errormsg").hide()
        $("#province-selector").val("")
        $("#city-selector").val("")
    })

    function cityList(code){
        $("#city-selector").empty();
        $("#inputCity").val()
        $.ajax({
            url:"/channelCity?code="+code,
            method:"get",
            success:function (data) {
                if(data.state == "000"){
                    $("#inputCity").val(data.data[0].name)
                    for (var pos in data.data){
                        var domi = "<option value='"+data.data[pos].code+"'>"+data.data[pos].name+"</option>"
                        $("#city-selector").append(domi)
                    }
                }
            }
        })
    }
</script>
</body>
</html>
